package com.sunky.rfidapp.network;

import retrofit2.Retrofit;

/**
 * Created by stan on 2018/3/13.
 */

public class RequestManager {


    private static Retrofit getRetrofit() {
        return NetBuilder.getInstance().getRetrofit();
    }

    public static BaseApi create() {
        return createService(); //改单例
    }

    private static BaseApi baseApi;

    private synchronized static BaseApi createService() {
        if (null == baseApi) {
            baseApi = getRetrofit().create(BaseApi.class);
        }
        return baseApi;
    }

    public synchronized static BaseApi refreshService() {
        baseApi = getRetrofit().create(BaseApi.class);
        return baseApi;
    }

}
